# data="生活不是电影，生活比电影苦"
# print(data[0:len(data):2])
# #从第一个位置到最后一个位置，步长为2的切片
# print(data[0::2])
# #逆序切片
# print(data[::-1])
# print(data[::-2])
# data="好好学习编程技术"
# i=0
# while i<len(data):
#     print(data[i],end='')
#     i+=1
# data='好好学习编程技术'
# for i in data:
#     print(i,end='')
# for i in range(11):
#     print(i,end=' ')
# num =0
# while True:
#     data=input("请输入内容：")
#     if data.isdecimal():
#         num=int(data)
#         break
#     else:
#         print("谁输入错误，请重新输入！")
# message="好好学习编程技术"
# for char in message:
#     if char=='习':
#         continue
#     print(char,end='')
# message="好好学习编程技术"
# for char in message:
#     if char=='习':
#         break
#     print(char,end='')
# num =999
# print(str(num))
# num =["小峰",11,["xiaowang"]]
# z=str(num)
# print(z,type(z))
# name="xiao峰"
# print(name[1])
# name[1]='x'
# print(name)
# data = list()
# #data = [] 以上这两种方式都不表示空列表
# print(data)
# welcome="欢迎来到游戏".center(30,"*")
# print(welcome)
# user_count=0
# while True:
#     user_count=input("请输入玩游戏的人数：")
#     if user_count.isdecimal():
#         user_count=int(user_count)
#         break
#     else:
#         print("输入的需要是数字，请重新输入！")
# message=f"有{user_count}参加游戏"
# print(message)
# user_name=[]
# for i in range(1,user_count+1):
#     tips=f"请输入玩家姓名{i}/{user_count}:"
#     name=input(tips)
#     user_name.append(name)
# print(user_name)
# data = ['xiaoli',20,'男']
# data.extend(['xiaowang',23,'女'])
# print(data)
# data = ['xiaoli',20,'男']
# data.insert(2,'西安')
# print(data)
# user_list = ["小王","雪","小张","雪"]
# while True:
#     if "雪" in user_list:
#         user_list.remove("雪")
#     else:
#         break
# print(user_list)
# user_list = ["小王","雪","小张","雪"]
# print(user_list.pop(1))
# print(user_list)
# user_list = ["小王","雪","小张","雪"]
# user_list.clear()
# print(user_list)
# user_list = ["小王","雪","小张","雪"]
# user_list.reverse()
# print(user_list)
# user_list = ["小王","雪","小张","雪"]
# user_list.sort() #按照对应的ASCII码比较
# print(user_list)
# num=[4,7,2,1]
# num.sort()#由小到大
# print(num)
# num.sort(reverse=True)#由大到小
# print(num)
# user_list=["小王","雪","xiaofeng","雪"]
# if "xiaofeng" in user_list:
#     print(user_list.index("xiaofeng"))
# else:
#     print("找不到！")
#案例：排队买火车票
# user_queue=[]
# ticket=5
# while True:
#     name=input("请输入你的名字进行排队购买(Q退出)：")
#     if name=="Q":
#         break
#     else:
#        user_queue.append(name)
# for i in range(ticket):
#     if ticket <=ticket and len(user_queue) > 0:
#         print(f"恭喜{user_queue.pop()}，买票成功")
# if len(user_queue) >0:
#     print(f"票数不足！非常抱歉，票已售完，以下几位用户请选择其他出行方式，名单：{user_queue}.")
# data = ["小王","雪","xiaofeng"]
# print(data*2)#得到一个新的列表
# print(data+['xiaoli','xiaoqin'])#得到一个新的列表
# print('xiaoli' in data) #判断元素是否在列表中，返回值类型是bool